<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
         function getJC(n){
            if(n<=1){
                return 1;
            }else{
                return n*getJC(n-1);
            }
             
        }
        var result=getJC(3);
            console.log(result);

           function getSum(n){
            if(n>1){
                return n+getSum(n-1);
            }
            return 1;
           }
           
           var result2=getSum(4);
            console.log(result2);
    </script>
</body>
</html>